//
//  CollectionView.m
//  InSuger
//
//  Created by dllo on 15/11/27.
//  Copyright © 2015年 Dior_3g. All rights reserved.
//

#import "CollectionView.h"

@implementation CollectionView

- (instancetype)initWithFrame:(CGRect)frame controller:(id)controller collectionViewLayout:(UICollectionViewLayout *)layout cell:(UICollectionViewCell *)cell reuse:(NSString *)reuse {
    
    self = [super initWithFrame:frame];
    
    if (self) {

        self.collectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:layout];
        [controller addSubview:_collectionView];
        self.collectionView.backgroundColor = [UIColor whiteColor];
        
        _collectionView.dataSource = self;
        _collectionView.delegate = self;
        
        [_collectionView registerClass:[cell class] forCellWithReuseIdentifier:reuse];
    }
    
    return self;
}







@end
